Kifier's MFI/STOCH Hidden Divergence/Trend BeaterMFI/STOCH Hidden Divergence/Trend Beater
General Idea:
My premise around this strategy was to make a general strategy for crypto that would help out with finding entry positions for when you’re bullish on a crypto and want to hold on for a while, and at the same time avoiding massive drops. Essentially a way to mix long term/ swing trading; I somewhat achieved my goal however it still requires a lot of logic tuning of the trend averages.
I’m a huge proponent of volume indicators and coupled with average closing price, I think this gives a really good idea of what is happening with the market. It gives an idea on the market and retail investor sentiment. This generally gives you logical entry positions (Although I don’t know how amazing that will work with all cryptos, there’s a fine line between a good strategy and one that just rides bubble market conditions, some would argue that’s still a success and others not)
How it works:
There are many components to the strategy that try to do different things:
First of all there are two types of entries, a MFI hidden divergence with a STOCH check, essentially it will only fire when a divergence is detected while STOCH is above 50%, however this might be changed in the future as due to the volatile nature of cryptos, the STOCH is not too effective. The second entry is a simple MFI/STOCH trend, if STOCH is above 50% and the trend is detected to be in a trending long, once a MFI crossover over the 50% line is detected an entry is placed, this is designed to get out profit where the divergence would otherwise be less accurate during strongly trending conditions.
-MFI is a great indicator, as a volume weighted momentum indicator I find it the most accurate of all, the STOCH however is a great indicator to get a general picture of simple market conditions and can filter out the emotional noise of retail investors.
-VWMA and an SMA (The bottom oscillator) gives an idea of the trend tacking into account of the volume, this serves as a more short term filter of the trend for filters.
-OBV checks are done between the OBV and an EMA of the OBV, to get the idea of a volume weighted long trend, which is important for crypto as there are massive rallies to go up due to retail greed, it’s great to jump onto it at the beginning, and get off before the stack of cards fall apart.
-ATR is used to detect when the market is relatively just ranging or moving sideways, which is where the hidden divergence entries are done, during predictable and profitable market conditions.
- Stop loss is based on the closest support of the entry, this is a nice medium of room to breath but also an actual stop loss.
Future plans and improvements:
Currently there’s a lot I want to improve, mostly the divergence detection and the overall sharpe ratio could be much better, but the current value of 0.5 gives me hope that the strategy is onto something. I also want to change TP from a percentage stop to something more dynamic but that might be too optimistic. The current plan is to paper trade test this either by manual or by a python bot, to see how it performs with some user input as well.
Cerca negli script per "stop loss"
Khair Day trade with profit lossBest used when applied for intraday trading. Users can customize length and deviation to fit their needs. Works best for high volatility stocks.
This strategy only works intraday intervals, so it means when you try to apply it to day/week/month it won't show any entry or exits.
Bollinger band breakout with non-standard deviation along with profit targets and stop loss.
There are 2 profit targets that can be adjusted based on individual preference.
This strategy minimizes risk and only opens trades when the probability of profitability is higher.
CryptoKillerCryptoKiller is a trend following trading system. It provides entry and exit points, a money management system and a trade management system.
The entry points (fuchsia line) are determined by CryptoKiller Oscillator (see other published script to understand how the oscillator works).
The trade management system provides the exit points in profit and in loss. This script works with multiple take profits (green lines), the initial position is liquidated little by little as the trend reaches the profit targets. Trade management also provides trailing stop exits to save the remaining profits.
Stop loss (red line) take into account the recent past of the chart to be determined, while take profits are fixed and have been calculated based on historical volatility.
The money management system is very simple, it plans to enter a position with a fixed percentage with respect to equity.
CryptoKiller, during an operation, also draws supports and resistances on the chart - determined by the oscillator (orange lines) these supports and resistances are used as a filter to understand where there is the greatest probability of trend development (some entry points provided by the oscillator will therefore not be considered by CryptoKiller as entry points, as in disagreement with the traced supports / resistances).
We know that an error appears in the backtest calculation, where the script is said to suffer from a bias, so the backtest calculation may not be accurate. Actually this happens in high times like H4 or daily, but CryptoKiller is not designed for these timeframes. it is a short-term strategy.
For more information read the author's instructions to contact us, we will send a PDF file with a more complete explanation of the strategy accompanied by screenshots.
Access to this script is granted along with access to CryptoKiller Oscillator.
Momentum Trading Strategy (Weekly Chart)The strategy will open position when there is momentum in the stock
The strategy will ride up your stop loss based on the super trend.
The strategy will close your operation when the market price crossed the stop loss.
The strategy will close operation when the line based on the volatility will crossed
JFRewards Indi Channel <Heikin> v4.0<>
SOP guidelines only given to JF members .
The ideas are:
1) Finding where to enter position of buying and sell.
2) Finding where is the realistic take profit target within 24 hours with maximum profits.
3) Finding Trailing STOP LOSS, Trailing Take Profit, Take Profit, STOP LOSS.
Fully tested with @Binance Exchanger with numerous of stablecoins and altcoins as well as BTC , ETH.
Performance cannot be shown due to non standard chart of Heikin Ashi.
Buy the Dips (by Coinrule)Taking your first steps into automated trading may be challenging. Coinrule's mission is to make it as easy as possible, also for beginners.
Here follows the best trading strategy to get started with Coinrule. This strategy doesn't involve complex indicators, yet was proved to be effective in the long term for many coins. Results seem to be improved when trading a coin vs Bitcoin.
The strategy buys the dips of a coin to sell with a profit. A stop-loss protects every trade.
Crypto markets offer high volatility and, thus, excellent opportunities for trading. Excluding times of severe downtrend, buying the dip is a simple and effective long-term trading strategy. The buy-signal is set to a 2% drop in a 30-minutes time frame.
Each trade comes with a take profit and a stop loss. Both set at 2%.
You can adjust these percentages to the market volatility as an advanced setup. You can backtest the outcomes using the backtesting tool from Tradingview
The strategy assumes each order to trade 30% of the available capital. A trading fee of 0.1% is taken into account. The fee is aligned to the base fee applied on Binance, which is the largest cryptocurrency exchange.
TrendMaAlignmentStrategy - Long term tradesThis is another strategy based on moving average alignment and HighLow periods. This is more suitable for long term trend traders and mainly for stocks.
Candle is colored lime if : Lookback Period has at least one bar with moving averages fully aligned OR None of the bars in Lookback periods has negatively aligned moving averages (More than half are positively aligned).
Candle is colored orange if : Lookback Period has at least one bar with moving averages fully aligned in negative way OR none of the bars in lookback has positively aligned moving averages (More than half are negatively aligned).
If either of above conditions are met, candle is colored silver.
Moving average alignment parameters:
Moving Average Type : MA Type for calculating Aligned Moving Average Index
Lookback Period : Lookback period to check highest and lowest Moving Average index.
HighLow parameters:
Short High/Low Period: Short period to check highs and lows
Long High/Low Period: Longer Period to check highs and lows.
If short period high == long period high, which means, instrument has made new high in the short period.
ATR Parameters:
ATR Length: ATR periods
StopMultiplyer: To set stop loss.
ReentryStopMultiplyer: This is used when signal is green buy stop loss on previous trade is hit. In such cases, new order will not be placed until it has certain distance from stop line.
Trade Prameters:
Exit on Signal : To be used with caution. Enabling it will allow us to get out on bad trades early and helps exit trades in long consolidation periods. But, this may also cause early exit in the trend. If instrument is trending nicely, it is better to keep this setting unchecked.
Trade direction : Default is long only. Short trades are not so successful in backtest. Use it with caution.
Backtest years : limit backtesting to certain years.
Part of the logic used from study's below:
Other strategies based on these two studies are below (which are meant for short - medium terms):
2 Candles Inside ATR2 agitated candles falling inside ATR range, awaiting possibly a big move.
Buy / Sell signals at combined high / low can be used as order with other as stop loss.
Counter trade, when this minimal stop loss is hit, is also as useful. However, wait till the SL candle closes, before opening position on the other side.
Works quite well on 15 mins chart, with settings of ATR duration 25 and multiplier 0.6. These settings are configurable, so feel free.
Lowkey System (Strategy)View study version
A long-only strategy that aim to detect the beginning of new bullish trends and their ends.
For entering a new position this script is waiting for a moving average crossover then wait for a volume increase relative to the current volatility.
For closing a position it's simply waiting for a crossunder of whether the MA or if enabled the stop loss.
This strategy is already configured to run on BTCUSD in a 4h timeframe but you can customize the moving average and the stop loss parameters to suit your needs.
I've worked a lot to write this script so I'm not giving it for free but you can try it for 10 days.
Contact me for more details.
Have fun!
PS: I'm french so please excuse me if I've made some grammar errors ;)
cryptomars 1.0 signal Concussion trend
Description:
1. In the indicator, there is an orange signal that fluctuates linearly. It is a buy signal when it goes from bottom to top. When the signal line remains in the upper position, it indicates a multi-party trend.
2. When it goes from top to bottom, it indicates a sell signal. When the signal line remains below, it indicates a sales trend.
3. Depending on the time level, when the position of the signal line changes, determine whether the current candle is completed or not according to the time level of the chart you selected to determine the signal. For example, if you select a chart level of 5 meters, then when the signal line changes, for example, it will send a sell signal from top to bottom. At this time, please do not rush to sell. You should wait for this 5 meter candlestick to complete. When the candle is over and the next candle is started, if the signal line remains in the top-down form, the sell signal is normal and you can sell it.
Because the position of the signal appears, it is the location of the sale. During the completion of the candlestick , the signal may disappear after disappearing. We only have to wait for a while to get a more stable deal.
4. The alarm setting is very simple. There are two lines in the indicator. One is the orange signal line that fluctuates up and down, and the other is the fixed zero line of “zero”.
We set it in the alarm. When the signal line passes "zero" from the top, the short signal is sent only when the candle map is completed. When the signal line passes "zero" from "up" below, the signal is sent for a long time when the candlestick is completed.
One trick, the appearance of the signal, is that the price runs in one direction for a while, so it appears at or near the bottom. Because, when we have already made a profit in the transaction, we can make a profit in advance, and we do not need to wait for the opposite signal to stop the profit and reduce the risk of profit retracement.
Because in this market, the fluctuations are very large, and the people who compete are also very fierce. What we need to do is to make every transaction as possible, and we are all profitable. If we sell and find that the price is still rising, please don't feel sorry, don't consider eating all the profits.
6. When the signal appears, in most cases, even in the impact trend, it will still run a distance in the direction of the signal, that is, you will profit, so please close the position and make a profit in time. Otherwise, when the price volatility is too small, you miss the profit point, the price starts to run in the opposite direction, and you may change from profit to loss.
BITMEX's trailing stop loss is a great feature, please use it flexibly.
7, if it is a shock trend, please try not to trade.
8. We recommend that you turn on the “cryptomars 3.0” and “cryptomars 2.0” indicators. No matter who signs the trade first, you can trade, which can help you get more profit.
9. Remember, I hope this indicator will be your powerful assistant, but please don't rely on it completely. Learning more trading knowledge and skills is even more important. Therefore, when we consider the profitable position, you can use your trading skills, MACD , KDJ, etc. to assist and profit in a more suitable position.
cryptomars signal short 2.0Description:
1. In the indicator, there is an orange signal that fluctuates linearly. It is a buy signal when it goes from bottom to top. When the signal line remains in the upper position, it indicates a multi-party trend.
2. When it goes from top to bottom, it indicates a sell signal. When the signal line remains below, it indicates a sales trend.
3. Depending on the time level, when the position of the signal line changes, determine whether the current candle is completed or not according to the time level of the chart you selected to determine the signal. For example, if you select a chart level of 5 meters, then when the signal line changes, for example, it will send a sell signal from top to bottom. At this time, please do not rush to sell. You should wait for this 5 meter candlestick to complete. When the candle is over and the next candle is started, if the signal line remains in the top-down form, the sell signal is normal and you can sell it.
Because the position of the signal appears, it is the location of the sale. During the completion of the candlestick , the signal may disappear after disappearing. We only have to wait for a while to get a more stable deal.
4. The alarm setting is very simple. There are two lines in the indicator. One is the orange signal line that fluctuates up and down, and the other is the fixed zero line of “zero”.
We set it in the alarm. When the signal line passes "zero" from the top, the short signal is sent only when the candle map is completed. When the signal line passes "zero" from "up" below, the signal is sent for a long time when the candlestick is completed.
One trick, the appearance of the signal, is that the price runs in one direction for a while, so it appears at or near the bottom. Because, when we have already made a profit in the transaction, we can make a profit in advance, and we do not need to wait for the opposite signal to stop the profit and reduce the risk of profit retracement.
Because in this market, the fluctuations are very large, and the people who compete are also very fierce. What we need to do is to make every transaction as possible, and we are all profitable. If we sell and find that the price is still rising, please don't feel sorry, don't consider eating all the profits.
6. When the signal appears, in most cases, even in the impact trend, it will still run a distance in the direction of the signal, that is, you will profit, so please close the position and make a profit in time. Otherwise, when the price volatility is too small, you miss the profit point, the price starts to run in the opposite direction, and you may change from profit to loss.
BITMEX's trailing stop loss is a great feature, please use it flexibly.
7, if it is a shock trend, please try not to trade.
8. We recommend that you turn on the “cryptomars 3.0” and “cryptomars 1.0” indicators. No matter who signs the trade first, you can trade, which can help you get more profit.
9. Remember, I hope this indicator will be your powerful assistant, but please don't rely on it completely. Learning more trading knowledge and skills is even more important. Therefore, when we consider the profitable position, you can use your trading skills, MACD , KDJ, etc. to assist and profit in a more suitable position.
cryptomars signal 3.0Description:
1. In the indicator, there is an orange signal that fluctuates linearly. It is a buy signal when it goes from bottom to top. When the signal line remains in the upper position, it indicates a multi-party trend.
2. When it goes from top to bottom, it indicates a sell signal. When the signal line remains below, it indicates a sales trend.
3. Depending on the time level, when the position of the signal line changes, determine whether the current candle is completed or not according to the time level of the chart you selected to determine the signal. For example, if you select a chart level of 5 meters, then when the signal line changes, for example, it will send a sell signal from top to bottom. At this time, please do not rush to sell. You should wait for this 5 meter candlestick to complete. When the candle is over and the next candle is started, if the signal line remains in the top-down form, the sell signal is normal and you can sell it.
Because the position of the signal appears, it is the location of the sale. During the completion of the candlestick , the signal may disappear after disappearing. We only have to wait for a while to get a more stable deal.
4. The alarm setting is very simple. There are two lines in the indicator. One is the orange signal line that fluctuates up and down, and the other is the fixed zero line of “zero”.
We set it in the alarm. When the signal line passes "zero" from the top, the short signal is sent only when the candle map is completed. When the signal line passes "zero" from "up" below, the signal is sent for a long time when the candlestick is completed.
One trick, the appearance of the signal, is that the price runs in one direction for a while, so it appears at or near the bottom. Because, when we have already made a profit in the transaction, we can make a profit in advance, and we do not need to wait for the opposite signal to stop the profit and reduce the risk of profit retracement.
Because in this market, the fluctuations are very large, and the people who compete are also very fierce. What we need to do is to make every transaction as possible, and we are all profitable. If we sell and find that the price is still rising, please don't feel sorry, don't consider eating all the profits.
6. When the signal appears, in most cases, even in the impact trend, it will still run a distance in the direction of the signal, that is, you will profit, so please close the position and make a profit in time. Otherwise, when the price volatility is too small, you miss the profit point, the price starts to run in the opposite direction, and you may change from profit to loss.
BITMEX's trailing stop loss is a great feature, please use it flexibly.
7, if it is a shock trend, please try not to trade.
8. We recommend that you turn on the “cryptomars 2.0” and “cryptomars 1.0” indicators. No matter who signs the trade first, you can trade, which can help you get more profit.
9. Remember, I hope this indicator will be your powerful assistant, but please don't rely on it completely. Learning more trading knowledge and skills is even more important. Therefore, when we consider the profitable position, you can use your trading skills, MACD , KDJ, etc. to assist and profit in a more suitable position.
[BoTo] Pump&Dump StrategyThis strategy uses only long positions. It isn't used short positions, it doesn't use marginal trade, it doesn't use a pyramiding.
It is strategy uses only one indicator. Ourselves have constructed the indicator for cryptocurrencies. We called it 'Pump&Dump Ocsilator'. You can read as this indicator works here:
Not usual stop
Strategy uses 2 ways for closing of an unprofitable position. But it is possible to use only one way.
Way 1: if the indicator has distinguished a dump, then the long position needs to be closed when the candle is closed (for an example: to close a position when time 00:00 if you have chosen daily timeframe)
Way 2: the user himself chooses the size in settings of this script. Percent. If the user has chosen 100%, means isn't used absolutely. Because the price will never fall by 100%. If the user has chosen less than 100%, for example 5%, then the long position needs to be closed if the low of a candle was less than this price level of choosed stop-loss. But the position needs to be closed too when the candle is closed.
Strategy
A pump-signal: if the candle green and her body is 3 times more than norm
A dump-signal: on the contrary, if the candle red and her body is 3 times more than norm
For opening of a long position: it is necessary any pump-signal (if the position hasn't been open yet)
For closing of a long position: several ways:
1) Or any dump-signal is necessary
2) Or a stop-loss which was chosen by the user is necessary
MACDouble & StochRSI w/ safeties and variable time interval v0.3UPDATE:
IMPORTANT!!! MAKE SURE "RECALCULATE AFTER ORDER FILLED" IS CHECKED. I will have it on by default in the future.
This is a continuation of my previous scripts of two MACD indicators with a Stochastic RSI indicator.
New features:
- Alternate MACD time interval
You can now set the time interval for the second MACD indicator to a different resolution than the displayed chart.
Uncheck the box and select the desired interval. For example, if your chart is set to 15min then first MACD will be set at 15 min and you can select 5 min for the second MACD.
- Alternate StoRSI time interval
You can (and should) set the StochRSI to a different time interval as well. StochRSI hasn't worked great with previous versions. Now you can set it to a different time resolution as well. I strongly recommend you set it at a higher (slower) resolution; for example if your chart is set at 15min then you should test setting the StochRSI at 30 or 45min.
- ' True" StochRSI logic
Trading logic for StochRSI is now a true StochRSI, instead of just reading "k" and ignoring "d", K now has to be greater than D to buy and less than to sell.
- Safeties
A primitive but low risk safety in the form of an uptrend/downtrend price safety. If current close+high isn't greater than the previous close and high then the buy order will not be executed. The same applies for sell orders.
- Cap on losses from short positions
A stop loss safety set to 9000 for exiting sell positions. This will need refinement in the future but this puts a cap on losses from any sell position. At an initial currency of 10,000 this translates to 90.00. If it is giving you problems simply delete line 78 from the source code.
Please feel free to ask any questions or send me suggestions. This is still very much a work in progress and I'll try to polish up the rough spots but it is fully functional. With a slower StochRSI and the safeties I have gotten it to consistently outperform the old 2x MACD strategy script---typically by 3-fold.
₿ober XM v1.3# ₿ober XM v1.3 Trading Bot Documentation
## Overview
The ₿ober XM v1.3 is an advanced dual-channel trading bot. It integrates multiple technical indicators, customizable risk management, and advanced order execution via webhook for automated trading. The bot's distinctive feature is its separate channel systems for long and short positions, allowing for asymmetric trade strategies that adapt to different market conditions.
### Key Features
- **Dual-Channel System**: Independent indicator settings for long and short positions
- **Multiple Entry Strategies**: Breakout, Pullback, and Mean Reversion options
- **Machine Learning Integration**: Predictive MLMA (Machine Learning Moving Average) for enhanced trend detection
- **Comprehensive Filtering**: Combines momentum, volatility, volume, and trend filters
- **Advanced Risk Management**: Dynamic position sizing, multiple stop-loss types, and trailing stops
- **Webhook Integration**: Direct connectivity to exchanges or third-party platforms
- **Configurable OBV MA Types**: Choose from multiple moving average types for OBV calculations
### General Settings
| Setting | Description | Default Value |
|---------|-------------|---------------|
| **Long Positions** | Enable or disable long trades | Enabled |
| **Short Positions** | Enable or disable short trades | Enabled |
| **Risk/Reward Area** | Visual display of stop-loss and take-profit zones | Enabled |
| **Long Entry Source** | Price data used for long entry signals | hl2 (High+Low/2) |
| **Short Entry Source** | Price data used for short entry signals | hl2 (High+Low/2) |
The bot allows you to trade long positions, short positions, or both simultaneously. Each direction has its own set of parameters, allowing for fine-tuned strategies that recognize the asymmetric nature of market movements.
### Webhook Configuration
| Setting | Description | Default Value |
|---------|-------------|---------------|
| **Long Entry Comment** | Webhook message for long entries | "ENTER-LONG" |
| **Short Entry Comment** | Webhook message for short entries | "ENTER-SHORT" |
| **Exit Comment** | Webhook message for position exits | "EXIT-ALL" |
| **Leverage** | Position size multiplier | 1.0 |
| **Reduce Only** | Restrict orders to reducing positions | Enabled |
| **Exchange Conditional Orders** | Place SL/TP directly on exchange | Disabled |
The webhook system allows for seamless integration with exchanges or third-party platforms:
- **Benefits**:
- Automated trade execution without manual intervention
- Immediate response to market conditions
- Consistent execution of your strategy
- **Implementation Notes**:
- Requires proper webhook configuration on your exchange or platform
- Test thoroughly with small position sizes before full deployment
- Consider latency between signal generation and execution
### Backtesting Period
Define a specific historical period to evaluate the bot's performance:
| Setting | Description | Default Value |
|---------|-------------|---------------|
| **Start Date** | Beginning of backtest period | January 1, 2025 |
| **End Date** | End of backtest period | December 31, 2026 |
- **Best Practice**: Test across different market conditions (bull markets, bear markets, sideways markets)
- **Limitation**: Past performance doesn't guarantee future results
## Entry and Exit Strategies
### Dual-Channel System
A key innovation of the Bober XM is its dual-channel approach:
- **Independent Parameters**: Each trade direction has its own channel settings
- **Asymmetric Trading**: Recognizes that markets often behave differently in uptrends versus downtrends
- **Optimized Performance**: Fine-tune settings for both bullish and bearish conditions
This approach allows the bot to adapt to the natural asymmetry of markets, where uptrends often develop gradually while downtrends can be sharp and sudden.
### Channel Types
#### 1. Keltner Channels
Traditional volatility-based channels using EMA and ATR:
| Setting | Long Default | Short Default |
|---------|--------------|---------------|
| **EMA Length** | 37 | 20 |
| **ATR Length** | 13 | 17 |
| **Multiplier** | 1.4 | 1.9 |
| **Source** | low | high |
- **Strengths**:
- Reliable in trending markets
- Less prone to whipsaws than Bollinger Bands
- Clear visual representation of volatility
- **Weaknesses**:
- Can lag during rapid market changes
- Less effective in choppy, non-trending markets
#### 2. Machine Learning Moving Average (MLMA)
Advanced predictive model using kernel regression (RBF kernel):
| Setting | Long Default | Short Default |
|---------|--------------|---------------|
| **Window Size** | 16 | 16 |
| **Forecast Length** | 3 | 3 |
| **Noise Parameter** | 0.43 | 0.44 |
| **Band Multiplier** | 0.6 | 0.5 |
| **Source** | low | high |
- **Strengths**:
- Predictive rather than reactive
- Adapts quickly to changing market conditions
- Better at identifying trend reversals early
- **Weaknesses**:
- More computationally intensive
- Requires careful parameter tuning
- Can be sensitive to input data quality
### Entry Strategies
| Strategy | Description | Ideal Market Conditions |
|----------|-------------|-------------------------|
| **Breakout** | Enters when price breaks through channel bands, indicating strong momentum | High volatility, emerging trends |
| **Pullback** | Enters when price retraces to the middle band after testing extremes | Established trends with regular pullbacks |
| **Mean Reversion** | Enters at channel extremes, betting on a return to the mean | Range-bound or oscillating markets |
#### Breakout Strategy (Default)
- **Implementation**: Enters long when price crosses above the upper band, short when price crosses below the lower band
- **Strengths**: Captures strong momentum moves, performs well in trending markets
- **Weaknesses**: Can lead to late entries, higher risk of false breakouts
- **Optimization Tips**:
- Increase channel multiplier for fewer but more reliable signals
- Combine with volume confirmation for better accuracy
#### Pullback Strategy
- **Implementation**: Enters long when price pulls back to middle band during uptrend, short during downtrend pullbacks
- **Strengths**: Better entry prices, lower risk, higher probability setups
- **Weaknesses**: Misses some strong moves, requires clear trend identification
- **Optimization Tips**:
- Use with trend filters to confirm overall direction
- Adjust middle band calculation for market volatility
#### Mean Reversion Strategy
- **Implementation**: Enters long at lower band, short at upper band, expecting price to revert to the mean
- **Strengths**: Excellent entry prices, works well in ranging markets
- **Weaknesses**: Dangerous in strong trends, can lead to fighting the trend
- **Optimization Tips**:
- Implement strong trend filters to avoid counter-trend trades
- Use smaller position sizes due to higher risk nature
### Confirmation Indicators
#### Pivot Point SuperTrend
Combines pivot points with ATR-based SuperTrend for trend confirmation:
| Setting | Default Value |
|---------|---------------|
| **Pivot Period** | 25 |
| **ATR Factor** | 2.2 |
| **ATR Period** | 41 |
- **Function**: Identifies significant market turning points and confirms trend direction
- **Implementation**: Requires price to respect the SuperTrend line for trade confirmation
#### Weighted Moving Average (WMA)
Provides additional confirmation layer for entries:
| Setting | Default Value |
|---------|---------------|
| **Period** | 15 |
| **Source** | ohlc4 (average of Open, High, Low, Close) |
- **Function**: Confirms trend direction and filters out low-quality signals
- **Implementation**: Price must be above WMA for longs, below for shorts
### Exit Strategies
#### On-Balance Volume (OBV) Based Exits
Uses volume flow to identify potential reversals:
| Setting | Default Value |
|---------|---------------|
| **Source** | ohlc4 |
| **MA Type** | HMA (Options: SMA, EMA, WMA, RMA, VWMA, HMA) |
| **Period** | 22 |
- **Function**: Identifies divergences between price and volume to exit before reversals
- **Implementation**: Exits when OBV crosses its moving average in the opposite direction
- **Customizable MA Type**: Different MA types provide varying sensitivity to OBV changes:
- **SMA**: Traditional simple average, equal weight to all periods
- **EMA**: More weight to recent data, responds faster to price changes
- **WMA**: Weighted by recency, smoother than EMA
- **RMA**: Similar to EMA but smoother, reduces noise
- **VWMA**: Factors in volume, helpful for OBV confirmation
- **HMA**: Reduces lag while maintaining smoothness (default)
#### ADX Exit Confirmation
Uses Average Directional Index to confirm trend exhaustion:
| Setting | Default Value |
|---------|---------------|
| **ADX Threshold** | 35 |
| **ADX Smoothing** | 60 |
| **DI Length** | 60 |
- **Function**: Confirms trend weakness before exiting positions
- **Implementation**: Requires ADX to drop below threshold or DI lines to cross
## Risk Management System
### Position Sizing
Automatically calculates position size based on account equity and risk parameters:
| Setting | Default Value |
|---------|---------------|
| **Risk % of Equity** | 50% |
- **Implementation**:
- Position size = (Account equity × Risk %) ÷ (Entry price × Stop loss distance)
- Adjusts automatically based on volatility and stop placement
- **Best Practices**:
- Start with lower risk percentages (1-2%) until strategy is proven
- Consider reducing risk during high volatility periods
### Stop-Loss Methods
Multiple stop-loss calculation methods with separate configurations for long and short positions:
| Method | Description | Configuration |
|--------|-------------|---------------|
| **ATR-Based** | Dynamic stops based on volatility | ATR Period: 14, Multiplier: 2.0 |
| **Percentage** | Fixed percentage from entry | Long: 1.5%, Short: 1.5% |
| **PIP-Based** | Fixed currency unit distance | 10.0 pips |
- **Implementation Notes**:
- ATR-based stops adapt to changing market volatility
- Percentage stops maintain consistent risk exposure
- PIP-based stops provide precise control in stable markets
### Trailing Stops
Locks in profits by adjusting stop-loss levels as price moves favorably:
| Setting | Default Value |
|---------|---------------|
| **Stop-Loss %** | 1.5% |
| **Activation Threshold** | 2.1% |
| **Trailing Distance** | 1.4% |
- **Implementation**:
- Initial stop remains fixed until profit reaches activation threshold
- Once activated, stop follows price at specified distance
- Locks in profit while allowing room for normal price fluctuations
### Risk-Reward Parameters
Defines the relationship between risk and potential reward:
| Setting | Default Value |
|---------|---------------|
| **Risk-Reward Ratio** | 1.4 |
| **Take Profit %** | 2.4% |
| **Stop-Loss %** | 1.5% |
- **Implementation**:
- Take profit distance = Stop loss distance × Risk-reward ratio
- Higher ratios require fewer winning trades for profitability
- Lower ratios increase win rate but reduce average profit
## Advanced Filtering System
### Momentum & Trend Filters
#### ADX Based Momentum Filter
| Setting | Default Value |
|---------|---------------|
| **Use Filter** | Enabled |
| **Apply D+/D- Check** | Enabled |
| **ADX Smoothing** | 34 |
| **DI Length** | 28 |
| **ADX Threshold** | 19 |
- **Function**: Ensures trades are taken only in strong trending conditions
- **Implementation**: Requires ADX above threshold for trade entry
#### RSI Filter
Uses Relative Strength Index to avoid overbought/oversold conditions:
| Setting | Default Value | Status |
|---------|---------------|--------|
| **RSI Period** | 14 | Disabled |
| **Overbought Level** | 70 | |
| **Oversold Level** | 30 | |
- **Function**: Prevents entries in potentially exhausted market conditions
- **Implementation**: Blocks long entries when RSI > 70, short entries when RSI < 30
### Volatility Filter
Controls trading during excessive market volatility:
| Setting | Default Value |
|---------|---------------|
| **Measure** | ATR |
| **Period** | 8 |
| **Threshold** | 1.3 |
| **Source** | ohlc4 |
- **Function**: Prevents trading during unpredictable market conditions
- **Implementation**: Blocks trades when current volatility exceeds threshold × average volatility
### Volume Filter
Ensures adequate market liquidity for trades:
| Setting | Default Value |
|---------|---------------|
| **Threshold** | 1.1× average |
| **Average Period** | 4 |
| **Smoothing Period** | 18 |
- **Function**: Prevents trading during low liquidity conditions
- **Implementation**: Requires current volume to exceed threshold × average volume
### Filter Combinations
The bot allows for simultaneous application of multiple filters:
- **Recommended Combinations**:
- Trending markets: ADX + Volume filters
- Ranging markets: Volatility + RSI filters
- All markets: Volume filter as minimum requirement
- **Performance Impact**:
- Each additional filter reduces the number of trades
- Quality of remaining trades typically improves
- Optimal combination depends on market conditions and timeframe
## Visual Indicators and Chart Analysis
The bot provides comprehensive visual feedback on the chart:
- **Channel Bands**: Keltner or MLMA bands showing potential support/resistance
- **Pivot SuperTrend**: Colored line showing trend direction and potential reversal points
- **Entry/Exit Markers**: Annotations showing actual trade entries and exits
- **Risk/Reward Zones**: Visual representation of stop-loss and take-profit levels
These visual elements allow for:
- Real-time strategy assessment
- Post-trade analysis and optimization
- Educational understanding of the strategy logic
## Implementation Guide
### TradingView Setup
1. Load the script in TradingView Pine Editor
2. Apply to your preferred chart and timeframe
3. Adjust parameters based on your trading preferences
4. Enable alerts for webhook integration
### Webhook Integration
1. Configure webhook URL in TradingView alerts
2. Set up receiving endpoint on your trading platform
3. Define message format matching the bot's output
4. Test with small position sizes before full deployment
### Optimization Process
1. Backtest across different market conditions
2. Identify parameter sensitivity through multiple tests
3. Focus on risk management parameters first
4. Fine-tune entry/exit conditions based on performance metrics
5. Validate with out-of-sample testing
## Performance Considerations
### Strengths
- Adaptability to different market conditions through dual channels
- Multiple layers of confirmation reducing false signals
- Comprehensive risk management protecting capital
- Machine learning integration for predictive edge
### Limitations
- Complex parameter set requiring careful optimization
- Potential over-optimization risk with so many variables
- Computational intensity of MLMA calculations
- Dependency on proper webhook configuration for execution
### Best Practices
- Start with conservative risk settings (1-2% of equity)
- Test thoroughly in demo environment before live trading
- Monitor performance regularly and adjust parameters
- Consider market regime changes when evaluating results
## Conclusion
The ₿ober XM v1.3 represents a sophisticated trading system combining traditional technical analysis with machine learning elements. Its dual-channel approach and comprehensive filtering system make it adaptable to various market conditions, while its risk management features help protect capital during adverse movements.
The addition of selectable OBV MA types in v1.3 provides further customization, allowing traders to fine-tune the exit strategy sensitivity according to market conditions and personal preferences. This enhancement offers more control over exit signals, potentially improving trade outcome profitability.
The bot is designed for traders who understand that no system is perfect, but that edge can be found through careful optimization and disciplined execution. With proper setup and realistic expectations, it provides a framework for systematic cryptocurrency trading across various market conditions.
2025 - Licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
Swing Strategy with TP Signal, RSI, EMA, Alerts📘 Swing High/Low Strategy with RSI, EMA Filters & TP Signal
This strategy detects swing highs and swing lows in real time and executes trades at key turning points — enhanced by momentum and trend filters.
It’s ideal for traders who prefer to:
Enter near market extremes
Use simple price action + indicator confluence
See clear visual confirmations for entry and take profit
🔍 How It Works
Swing Detection: Uses a custom swing high/low algorithm that spaces signals to avoid clutter.
Buy Setup:
A new swing low is detected
RSI is below a user-defined threshold (default 40 = oversold)
Price is above the EMA (confirming trend support)
Sell Setup:
A new swing high is detected
RSI is above a threshold (default 60 = overbought)
Price is below the EMA (confirming downtrend pressure)
When all conditions are met, the strategy places a market order with:
Stop Loss: % below/above entry (user defined)
Take Profit: % above/below entry
💰 Take Profit Signals
When a trade hits TP, a green or red circle is plotted on the chart to show the exit point
This helps visually confirm that the strategy hit its goal and managed risk correctly
⚙️ Fully Configurable
Swing Length: Number of bars to consider for swing points
Min Bars Between Swings: Avoid overlapping signals
RSI Length and thresholds
EMA Length for trend filtering
TP/SL %: Adjustable per instrument
📈 Great For
Scalping or swing trading
Trend pullback traders
Anyone who likes clean signals with stop/target logic
🔔 Includes Alerts
Real-time alerts for both BUY and SELL setups
Signals By RootKitWhat the Script Does (Summary):
🚀 Trade Entries:
Detects trend reversals using a custom volatility-based channel breakout system:
If price breaks below an upper channel, it signals a downtrend.
If price breaks above a lower channel, it signals an uptrend.
Uses momentum shifts (CMO) and RSI to detect support and resistance conditions (e.g., oversold/overbought pivot areas).
Enters:
Long (buy) when an uptrend begins.
Short (sell) when a downtrend begins.
🛑 Trade Exits:
Uses configurable exit strategies, selectable by the user:
ATR-based: Targets based on a multiple of ATR.
Percentage-based: Fixed percent profit/loss from entry.
Fixed offset: Static price distance for TP/SL.
📊 Visual Elements:
Draws entry, stop loss, and take profit lines and labels them on the chart.
Displays signal shapes (circles and labeled triangles) at buy/sell points.
Plots a colored cloud (EMA-based) that changes color based on MACD direction/strength.
Draws regression-like visual zones for trade clarity.
📈 Additional Tools and Features:
Alerts: Alerts trigger on every buy/sell signal.
Prevents overlapping positions (optional).
Trade Statistics Table: Displays total trades, wins, losses, and win rate on the chart.
⚙️ Customizable Inputs:
Trend Sensitivity: Adjusts how tight or loose the breakout detection is.
TP/SL Method: Switch between ATR, % or fixed-point risk management.
Cloud visibility & Signal Labels: Toggle visual aids on/off.
MACD-enhanced cloud coloring for trend confirmation.
💡 Use Case:
Ideal for traders looking for a turnkey trend-reversal strategy with built-in risk control, dynamic trade management, and clear visuals. Suitable for futures, indices, or forex on timeframes like 5m–1h.
FloridaMan Market Data──────────────────────────────
FloridaMan Market Data Strategy – User Manual
──────────────────────────────
1. OVERVIEW
––––––––––––––
• **Purpose:**
This strategy uses market data and advanced techniques (leveraging the Trading-IQ/ICT library) to analyze market structure, detect order blocks, fair value gaps, liquidity sweeps, and other significant levels. It is designed for futures and other instruments, incorporating multiple methods for signal generation and risk management.
• **How It Works:**
The script gathers data on market structure (such as break of structure, market shifts, strong highs/lows) and uses it to draw blocks and levels on the chart. It also calculates levels like fair value gaps (FVGs), displacements, and the “Power Of Three” indicators. In addition, it integrates models like the Unicorn and Silver Bullet strategies, plus liquidity raid concepts. A statistics table and visual labels/boxes are rendered on the chart to help you interpret the market.
──────────────────────────────
2. STRATEGY SETTINGS & PROPERTIES
–––––––––––––––––––––––––––––––
• **Initial Capital, Quantity, Order Processing:**
– The strategy is configured with an initial capital (e.g., 50,000) and a fixed order quantity (e.g., 5 units).
– It processes orders on close and recalculates on every tick, ensuring it responds in real time.
– There are limits set on the number of labels, lines, boxes, and polylines created to ensure script performance.
• **Commission & Slippage:**
– Commission is defined as a small percentage (0.02%) to simulate trading costs.
– Slippage is set to a value (such as 2 ticks) to account for execution delays.
──────────────────────────────
3. INPUTS & CONFIGURATION GROUPS
–––––––––––––––––––––––––––––––––––
A. **Timeframe**
– **User Timeframe (userTF):**
An input for the timeframe (in seconds) used by certain calculations. This lets the script work with multiple timeframes.
B. **Display & Mode Settings**
– **Lite Mode:**
A toggle (true/false) that, when enabled, minimizes visual clutter by simplifying the displayed elements.
– **Label Levels:**
Option for where box labels are placed – for example, "Inside" displays labels within the boxes, "Outside" shows them on the outside, or "None" disables labels.
– **Table Location & Size:**
Allows you to choose where on the chart the strategy’s statistics table appears (e.g., Top Right, Middle Center) and what text size it uses.
C. **Market Structure Inputs**
These settings adjust the visualizations related to market structure:
– **Show Break of Structure (BOS):**
Toggle whether to display the break of structure—key price points where the market’s trend may reverse.
– **Show Market Structure Shift (MSS):**
Toggle whether to display shifts in market structure.
– The colors for BOS and MSS can be set to visually distinguish them.
D. **Block & Rejection Levels**
– **Bullish/Bearish Order Blocks (OB):**
Inputs control how many order blocks to display for bullish and bearish scenarios, plus the colors used. Order blocks indicate areas where price has shown strong moves.
– **Bullish/Bearish Breaker Blocks (BB):**
Set the number and color of breaker blocks, which are similar to order blocks but represent different market conditions.
– **Bullish/Bearish Rejection Blocks (RB):**
Number and color settings for rejection blocks that indicate potential rejection zones.
E. **Strong Levels**
– **Strong Highs/Lows To Show:**
Inputs to determine how many strong highs or lows are visible. These levels are typically areas where price has reacted strongly.
– Colors for strong highs and lows can be configured to enhance visual clarity.
F. **Fair Value Gap (FVG) & Displacement Settings**
– **Only FVGs After Liquidity Sweep:**
When enabled, this restricts displayed FVGs (price gaps) to those formed after a significant liquidity sweep.
– **FVG Up/Down and Displacement Counts & Colors:**
Control how many FVGs or displacement zones are shown and their associated colors.
G. **Previous Bar Levels & Equal Levels**
– **Previous Bar High/Low Display:**
Toggles for showing levels based on the previous bar’s high and low.
– **Equal Levels:**
Option to display “equal levels” which are similar prices that repeat, offering additional support/resistance insight.
H. **Power Of Three (Po3) & Macros**
– **Po3 Timeframe(s):**
Choose one or two timeframes for Po3 levels that help gauge market structure over different periods.
– **Show Po3 / Macros:**
Toggles to display these additional visual indicators.
I. **Algorithm Settings**
These include more advanced settings related to liquidity sweep aggressiveness, and other proprietary model parameters.
J. **Unicorn & Silver Bullet Strategies**
– **Unicorn Model:**
Toggles for using the Unicorn strategy for long or short trades.
Additional settings allow you to choose exit levels (TP and SL) and adjust entry parameters.
– **Silver Bullet Strategy:**
Similar toggles and inputs exist for Silver Bullet strategy setups.
K. **Liquidity Raid & OTE (Optimal Trade Entry)**
– **Liquidity Raid Settings:**
Includes session time ranges (in New York time), trade toggles for long/short liquidity raids, TP/SL methods for these raids, and optional Fibonacci inputs.
– **OTE Settings:**
Controls parameters for retracement-based entries (like retracement levels for TP/SL and tick adjustments).
──────────────────────────────
4. VISUAL ELEMENTS
–––––––––––––––––––
• **Lines and Labels:**
The strategy draws lines and labels to mark entry prices, stop losses, and take profits. These update dynamically as market conditions change.
• **EMA Cloud and MACD Cloud Fills:**
An EMA cloud (built from the “Cloud MA Period”) is drawn on the chart to represent the general trend. In addition, color fills (using MACD values) add further context to the strength of the trend.
• **Order Blocks, Breaker Blocks, and Rejection Blocks:**
Blocks are drawn on the chart based on market structure inputs. Their display (the number of blocks and colors) can be set to help highlight where price may reverse or continue.
• **Statistics Table:**
A table is rendered (in your chosen location) showing key performance metrics such as total trades, winning/losing trades, and win rate.
──────────────────────────────
5. HOW TO USE THIS STRATEGY
–––––––––––––––––––––––––––––––
1. **Load the Script:**
Paste the script into the TradingView Pine Editor and add it to your chart.
2. **Configure Settings:**
Open the strategy’s settings panel. Adjust the inputs under their respective groups:
• In "Trend Strategy Inputs," set your price source, sensitivity (which affects channel width), ATR details, and EMA cloud appearance.
• In "TP/SL Settings," choose your exit method and set the multipliers or offsets accordingly.
• In "Position Management," decide whether you want to allow multiple simultaneous trades.
• Under the various visual groups (Market Structure, Blocks, Strong Levels, etc.), configure the number of levels to display and their colors.
• Advanced groups (Liquidity Raid, Unicorn, Silver Bullet, OTE) offer further customization if you want to use these models.
3. **Interpret the Visuals:**
– **Entry/Exit Lines:** See clear horizontal lines at trade entry, stop loss, and take profit levels.
– **EMA Cloud & MACD Fill:** These help you visualize the overall trend. A blue cloud suggests bullish strength, while a red cloud implies bearish pressure.
– **Order Blocks/Rejection Blocks:** These areas mark zones where price has previously reversed or stalled.
4. **Review Trade Statistics:**
The table displays key performance data. Use this information to refine your settings for better performance.
5. **Backtest & Monitor:**
Use TradingView’s backtest tools to see how the strategy performed historically. Adjust the settings as needed to match your risk tolerance and trading style.
──────────────────────────────
SUMMARY
──────────────────────────────
This strategy combines sophisticated market data analysis with multiple trading models (including traditional market structure, liquidity raids, Unicorn and Silver Bullet models) to provide a comprehensive trading tool. By adjusting the various input settings, you can fine-tune the strategy to suit different instruments, market environments, and risk preferences. All visual elements on the chart—from cloud fills to order blocks and statistical overlays—are designed to help you quickly assess market conditions and the performance of the strategy.
Happy Trading!
Gold USD 1 Hour TM Consolidation Breakout Optimized✅ Gold (XAUUSD),
✅ 1-hour timeframe (1H),
✅ Fixed stop-loss: 10 points,
✅ Take profit using trailing stop with a Risk-Reward Ratio (RRR) target of 3.5,
✅ Consolidation range: 15 candles,
✅ Consolidation lookback: 10 candles.
Hierarchical + K-Means Clustering Strategy===== USER GUIDE =====
Hierarchical + K-Means Clustering Strategy
OVERVIEW:
This strategy combines hierarchical clustering and K-means algorithms to analyze market volatility patterns
and generate trading signals. It uses a modified SuperTrend indicator with ATR-based volatility clustering
to identify potential trend changes and market conditions.
KEY FEATURES:
- Advanced volatility analysis using hierarchical clustering and K-means algorithms
- Modified SuperTrend indicator for trend identification
- Multiple filter options including moving average and ADX trend strength
- Volume-based exit mechanism to protect profits
- Customizable appearance settings
SETTINGS EXPLANATION:
1. SuperTrend Settings:
- ATR Length: Period for ATR calculation (default: 11)
- SuperTrend Factor: Multiplier for ATR to determine trend bands (default: 3)
2. Hierarchical Clustering Settings:
- Training Data Length: Number of bars used for clustering analysis (default: 200)
3. Appearance Settings:
- Transparency 1 & 2: Control the opacity of trend lines and fills
- Bullish/Bearish Color: Colors for uptrend and downtrend visualization
4. Time Settings:
- Start Year/Month: Define when the strategy should start executing trades
5. Filter Settings:
- Moving Average Filter: Uses SMA to filter trades (only enter when price is on correct side of MA)
- Trend Strength Filter: Uses ADX to ensure trades are taken in strong trend conditions
6. Volume Stop Loss Settings:
- Volume Ratio Threshold: Controls sensitivity of volume-based exits
- Monitoring Delay Bars: Number of bars to wait before monitoring volume for exit signals
HOW TO USE:
1. Apply the indicator to your chart
2. Adjust settings according to your trading preferences and timeframe
3. Long signals appear when price crosses above the SuperTrend line (▲k marker)
4. Short signals appear when price crosses below the SuperTrend line (▼k marker)
5. The strategy automatically manages exits based on volume balance conditions
INTERPRETATION:
- Green line/area: Bullish trend - consider long positions
- Red line/area: Bearish trend - consider short positions
- Yellow line: Moving average for additional trend confirmation
- Volume balance exits occur when buying/selling pressure equalizes
RECOMMENDED TIMEFRAMES:
This strategy works best on 1H, 4H, and daily charts for most markets.
For highly volatile assets, shorter timeframes may also be effective.
RISK MANAGEMENT:
Always use proper position sizing and consider setting additional stop losses
beyond the strategy's built-in exit mechanisms.
===== END OF USER GUIDE =====
Bollinger Bands by Abu ElyasBollinger Bands with Adjustable Stop Loss (Long-Only)
This strategy uses a Bollinger Band breakout approach to enter long positions and incorporates an adjustable stop loss for risk management.
Below is an overview of the logic, parameters, and usage instructions.
1. Bollinger Bands Logic
Basis (Middle Band): A moving average (type selectable by the user) of the chosen source, typically the closing price.
Upper Band: The basis plus a specified number of standard deviations (user-defined multiplier).
Lower Band: The basis minus the same number of standard deviations.
2. Entry Triggers
The strategy enters a long position when the close price rises above the upper Bollinger Band , suggesting a potential bullish breakout.
This logic is only applied within a user-specified date range (adjustable in the strategy’s inputs).
3. Exit Triggers
1. Bollinger Band Exit:
If the close price drops below the lower Bollinger Band , the strategy closes the position, indicating a loss of bullish momentum.
2. Stop Loss Exit:
A default 8% stop loss is set, which automatically exits the trade if the close falls 8% below the entry price.
This stop-loss percentage is adjustable from the strategy’s settings, allowing users to tailor risk based on their preferences.
3. Date Range:
If the current bar is outside of the specified start/end dates, the strategy will also exit any open positions.
4. Position Sizing & Other Settings
1- Position Size:
By default, the script uses 100% of account equity for each trade.
2- Commissions & Slippage:
Commission is set to 0%, and slippage is set to 3 ticks.
3- Timeframe Handling:
You can select a custom timeframe or leave it blank to use the chart’s timeframe.
5. Customization
1. Bollinger Bands Parameters:
Length of the moving average, type of moving average (SMA, EMA, etc.), and the standard deviation multiplier can be adjusted.
2. Stop Loss (%)
The default stop loss of 8% can be changed in the script’s input settings to any percentage you prefer.
3. Date Filter:
Modify the start/end dates to control the historical period over which the strategy executes trades.
6. Notes & Best Practices
1- No Short Trades:
This is a long‐only strategy. It will either be in a long position or flat (no open position).
2- Risk Management:
An 8% stop loss may or may not align with your personal risk tolerance. Always adjust according to market conditions and your own trading style.
3- Market Gaps & Volatility:
In highly volatile markets, slippage or gaps can cause the actual exit price to be worse than the intended stop-loss level.
4- Test Thoroughly:
Backtest on different timeframes and market conditions. No single strategy works in all scenarios.
7. Disclaimer
Educational Use Only: This script is for informational and illustrative purposes and should not be considered financial advice.
No Guarantee of Profit: Past performance does not guarantee future results. Trading involves substantial risk, and it is possible to lose more than your initial investment.
Consult a Professional: Always consult a qualified financial advisor before making investment decisions.
Use this script as a foundation and personalize it based on your trading style, tolerance for drawdowns, and market conditions.
Arpeet MACDOverview
This strategy is based on the zero-lag version of the MACD (Moving Average Convergence Divergence) indicator, which captures short-term trends by quickly responding to price changes, enabling high-frequency trading. The strategy uses two moving averages with different periods (fast and slow lines) to construct the MACD indicator and introduces a zero-lag algorithm to eliminate the delay between the indicator and the price, improving the timeliness of signals. Additionally, the crossover of the signal line and the MACD line is used as buy and sell signals, and alerts are set up to help traders seize trading opportunities in a timely manner.
Strategy Principle
Calculate the EMA (Exponential Moving Average) or SMA (Simple Moving Average) of the fast line (default 12 periods) and slow line (default 26 periods).
Use the zero-lag algorithm to double-smooth the fast and slow lines, eliminating the delay between the indicator and the price.
The MACD line is formed by the difference between the zero-lag fast line and the zero-lag slow line.
The signal line is formed by the EMA (default 9 periods) or SMA of the MACD line.
The MACD histogram is formed by the difference between the MACD line and the signal line, with blue representing positive values and red representing negative values.
When the MACD line crosses the signal line from below and the crossover point is below the zero axis, a buy signal (blue dot) is generated.
When the MACD line crosses the signal line from above and the crossover point is above the zero axis, a sell signal (red dot) is generated.
The strategy automatically places orders based on the buy and sell signals and triggers corresponding alerts.
Advantage Analysis
The zero-lag algorithm effectively eliminates the delay between the indicator and the price, improving the timeliness and accuracy of signals.
The design of dual moving averages can better capture market trends and adapt to different market environments.
The MACD histogram intuitively reflects the comparison of bullish and bearish forces, assisting in trading decisions.
The automatic order placement and alert functions make it convenient for traders to seize trading opportunities in a timely manner, improving trading efficiency.
Risk Analysis
In volatile markets, frequent crossover signals may lead to overtrading and losses.
Improper parameter settings may cause signal distortion and affect strategy performance.
The strategy relies on historical data for calculations and has poor adaptability to sudden events and black swan events.
Optimization Direction
Introduce trend confirmation indicators, such as ADX, to filter out false signals in volatile markets.
Optimize parameters to find the best combination of fast and slow line periods and signal line periods, improving strategy stability.
Combine other technical indicators or fundamental factors to construct a multi-factor model, improving risk-adjusted returns of the strategy.
Introduce stop-loss and take-profit mechanisms to control single-trade risk.
Summary
The MACD Dual Crossover Zero Lag Trading Strategy achieves high-frequency trading by quickly responding to price changes and capturing short-term trends. The zero-lag algorithm and dual moving average design improve the timeliness and accuracy of signals. The strategy has certain advantages, such as intuitive signals and convenient operation, but also faces risks such as overtrading and parameter sensitivity. In the future, the strategy can be optimized by introducing trend confirmation indicators, parameter optimization, multi-factor models, etc., to improve the robustness and profitability of the strategy.
Liquidity Trading Algorithm (LTA)
The Liquidity Trading Algorithm is an algorithm designed to provide trade signals based on
liquidity conditions in the market. The underlying algorithm is based on the Liquidity
Dependent Price Movement (LDPM) metric and the Liquidity Dependent Price Stability (LDPS)
algorithm.
Together, LDPM and LDPS demonstrate statistically significant forecasting capabilities for price-
action on equities, cryptocurrencies, and futures. LTA takes these liquidity measurements and
translates them into actionable insights by way of entering or exiting a position based
on the future outlooks, as measured by the current liquidity status.
The benefit of LTA is that it can incorporate these powerful liquidity measurements into
actionable insights with several features designed to help you tailor LTA's behavior and
measurements to your desired vantage point. These customizable features come by the way of determining LTA's assessment style, and additional monitoring systems for avoiding bear and bull traps, along with various other quality of life features, discussed in more detail below.
First, a few quick facts:
- LTA is compatible on a wide array of instruments, including Equities, Futures, Cryptocurrencies, and Forex.
- LTA is compatible on most intervals in so long as the data can be calculated appropriately,
(be sure to do a backtest on timescales less than 1-minue to ensure the data can be computed).
- LTA only measures liquidity at the end of the interval of the chart chosen, and does not respond to conditions during the candle interval, unless specified (such as with `Stops`).
- LTA is interval-dependent, this means it will measure and behave differently on different
intervals as the underlying algorithms are dependent on the interval chosen.
- LTA can utilize fractional share sizing for cryptocurrencies.
- LTA can be restricted to either bullish or bearish indications.
- Additional Monitoring Systems are available for additional risk mitigation.
In short, LTA is a widely applicable, unique algorithm designed to translate liquidity measurements into liquidity insights.
Before getting more into the details, here is a quick list of the main features and settings
available for customization:
- Backtesting Start Date: Manual selection of the start date for the algorithm during backtesting.
- Assessment Style: adjust how LDPM and LDPS measure and respond to changes in liquidity.
- Impose Wait: force LTA to wait before entering or exiting a position to ensure conditions have remained conducive.
- Trade Direction Allowance: Restrict LTA to only long or only short, if desired.
- Position Sizing Method: determine how LTA calculates position sizing.
- Fractional Share Sizing: allow LTA to calculate fractional share sizes for cryptocurrencies
- Max Size Limit: Impose a maximum size on LTA's positions.
- Initial Capital: Indicate how much capital LTA should stat with.
- Portfolio Allotment: Indicate to LTA how much (in percentages) of the available balance should be considered when calculating position size.
- Enact Additional Monitoring Systems: Indicate if LTA should impose additional safety criteria when monitoring liquidity.
- Configure Take Profit, Stop-Loss, Trailing Stop Loss
- Display Information tables on the current position, overall strategy performance, along
with a text output showing LTA's processes.
- Real-time text output and updates on LTA's inner workings.
Let's get into some more of the details.
LTA's Assessment Style
LTA's assessment style determines how LTA collects and responds to changing data. In traditional terms, this is akin to (but not quite exactly the same as) the sensitivity versus specificity spectrum, whereby on one end (the sensitive end), an algorithm responds to changes in data in a reactive manner (which tends to lower its specificity, or how often it is correct in its indications), and on the other end, the opposite one, the algorithm foresakes quick changes for longevity of outlook.
While this is in part true, it is not a full view of the underlying mechanisms that changing the assessment style augments. A better analogy would be that the sensitive end of the spectrum (`Aggressive`) is in a state such that the algorithm wants to changing its outlooks, and as such, with changes in data, the algorithm has to be convinced as to why that is not a good idea to change outlooks, whereas the the more specific states (`Conservative`, `Diamond`) must be convinced that their view is no longer valid and that it needs to be changed.
This means the `Aggressive` and the `Diamond` settings fundamentally differ not just in their
data collection, but also in the data processing such that the `Aggressive` decision tree has to
be convinced that the data is the same (as its defualt is that it has changed),
and the `Diamond` decision tree has to be convinced that the data is not the same, and as such, the outlook need changed.
From there, the algorithm cooks through the data and determines to what the outlook should be changed to, given the current state of liquidity.
`Balanced` lies in the middle of this balance, attempting to balance being open to new ideas while not removing the wisdom of the past, as it were.
On a scale of most `sensitive` to most `specific`, it is as follows: `Aggressive`, `Balanced`,
`Conservative`, `Diamond`.
Functionally, these different modes can help in different liquidity environments, as certain
environments are more conducive to an eager approach (such as found near `Aggressive`) or are more conducive to a more conservative approach, where sudden changes in liquidity are known to be short-lived and unremarkable (such as many previously identified bull or bear traps).
For instance, on low interval views, it can often-times be beneficial to keep the algorithm towards the `Sensitive` end, since on the lower-timeframes, the crosswinds can change quite dramatically; whereas on the longer intervals, it may be useful to maintain a more `Specific` algorithm (such as found near `Diamond` mode) setting since longer intervals typically lend themselves to longer time-horizons, which themselves typically lend themselves to "weathering the storm", as it were.
LTA's Assessment Style is also supported by the Additional Monitoring Systems which works
to add sensitivity without sacrificing specificity by enacting a separate monitoring system, as described below.
Additional Monitoring Systems
The Additional Monitoring System (AMS) attempts to add more context to any changes in liquidity conditions as measured, such that LTA as a whole will have an expanded view into any rapidly changing liquidity conditions before these changes manifest in the traditional data streams. The ideal is that this allows for early exits or early entrances to positions "a head of time".
The traditional use of this system is to indicate when liquidity is suggestive of the end of a particular run (be it a bear run or a bull run), so an early exit can be initiated (and thus,
downside averted) even before the data officially showcase such changes. In such cases (when AMS becomes activated), the algorithm will signal to exit any open positions, and will restrict the opening of any new positions.
When a position is exited because of AMS, it is denoted as an `Early Exit` and if a position is prevented from being entered, the text output will display `AM prevented entry...` to indicate that conditions are not meeting AMS' additional standards.
The algorithm will wait to make any actions while `AMS` is `active` and will only enter into a new position once `AMS` has been `deactivated` and overall liquidity conditions are appropriate.
Functionally, the benefits of AMS translate to:
- Toggeling AMS on will typically see a net reduction in overall profitability, but
- AMS will typically (almost always) reduce max drawdown,
an increases in max runup, and increase return-over-maxdrawdown, and
- AMS can provide benefit for equities that experience a lot of "traps" by navigating early
entrance and early exits.
So in short, AMS is way of adding an additional level of liquidity monitoring that attempts to
exit positions if conditions look to be deteriorating, and to enter conditions if they look to be
improving. The cost of this additional monitoring, however, is a greater number of trades indicated, and a lower overall profitability.
Impose Wait
Note: `Impose Wait` will not force Take Profit, Stop Loss, or Trailing Stop Loss to
wait.
LTA can be indicated to `wait` before entering or exiting a position if desired. This means that if conditions change, whereas without a `wait` imposed, the algorithm would immediately indicate this change via a signal to alter the strategy's position, with a `wait` imposed, the algorithm will `wait` the indicated number of bars, and then re-check conditions before proceeding.
If, while waiting, conditions change to a state that is no longer compatible with the "order-in-
waiting", then the order-in-waiting is removed, and the counts reset (i.e.: conditions must remain favorable to the intended positional change throughout the wait period).
Since LTA works at the end-of-intervals, there is an inherently "built-in" wait of 1 bar when
switching directly from long to short (i.e.: if a full switch is indicated, then it is indicated as
conditions change -> exit new position -> wait until -> check conditions ->
enter new position as indicated). Thus, to impose a wait of `1 bar` would be to effectively have a total of two candles' ends prior to the entrance of the new position).
There are two main styles of `Impose Wait` that you can utilize:
- `Wait` : this mode will cause LTA to `wait` when both entering and exiting a position (in so long as it is not an exit signaled via a Take Profit, Stop Loss or Trailing Stop Loss).
- `Exit-Wait` : This mode will >not< cause LTA to `wait` if conditions require the closing of a position, but will force LTA to wait before entering into a position.
Position:
In addition to the availability to restrict LTA to either a long-only or short-only strategy, LTA
also comprises additional flexibility when deciding on how it should navigate the markets with
regards to sizing. Notably, this flexibility benefits several aspects of LTA's existence, namely the ability to determine the `Sizing Method`, or if `Fractional Share Sizing` should be employed, and more, as discussed below.
Position Sizing Method
There are two main ways LTA can determine the size of a position. Either via the `Fixed-Share` choice, or the `Fixed-Percentage` choice.
- `Fixed-Share` will use the amount indicated in the `Max Sizing Limit` field as the position size, always.
Note: With `Fixed-Share` sizing, LTA will >not< check if the balance is sufficient
prior to signaling an entrance.
- `Fixed-Percentage` will use the percentage amount indicated in the `Portfolio Allotment` field as the percentage of available funds to use when calculating the position size. Additionally, with the `Fixed-Percentage` choice, you can set the `Max Sizing Limit` if desired, which will ensure that no position will be entered greater than the amount indicated in the field.
Fractional Share Sizing
If the underlying instrument supports it (typically only cryptocurrencies), share sizing can be
fractionalized. If this is done, the resulting positin size is rounded to `4 digits`. This means any
position with a size less than `0.00005` will be rounded to `0.0000`
Note: Ensure that the underlying instrument supports fractional share sizing prior
to initiating.
Max Sizing Limit
As discussed above, the `Max Sizing Limit` will determine:
- The position size for every position, if `Sizing Method : Fixed-Share` is utilized, or
- The maximum allowed size, regardless of available capital, if `Sizing Method : Fixed-Percentage` is utilized.
Note: There is an internal maximum of 100,000 units.
Initial Capital
Note: There are 2 `Initial Capital` settings; one in LTA's settings and one in the
`Properties` tab. Ensure these two are the same when doing backtesting.
The initial capital field will be used to determine the starting balanace of the strategy, and
is used to calculate the internal data reporting (the data tables).
Portfolio Allotment
You can specify how much of the total available balance should be used when calculating the share size. The default is 100%.
Stops
Note: Stops over-ride `AMS` and `Impose Wait`, and are not restricted to only the
end-of-candle and will occur instantaneously upon their activation. Neither `AMS` nor `Impose Wait` can over-ride a signal from a `Take-Profit`, `Stop-Loss`, or a `Trailing-Stop Loss`.
LTA enhouses three stops that can be configured, a `Take-Profit`, a `Stop-Loss` and a `Trailing-Stop Loss`. The configurations can be set in the settings in percent terms. These exit signals will always over-ride AMS or any other restrictions on position exit.
Their configuration is rather standard; set the percentages you want the signal to be sent at and so it will be done.
Some quick notes on the `Trailing-Stop Loss`:
- The activation percentage must be reached (in profits) prior to the `Traililng-Stop Loss`
from activating the downside protection. For example, if the `Activation Percentage` is 10%, then unless the position reaches (at any point) a 10% profit, then it will not signal any exits on the downside, should it occur.
- The downside price-point is continuously updated and is calculated from the maximum profit reached in the given position and the loss percentage placed in the appropriate field.
Data Tables and Data Output
LTA provides real-time data output through a variety of mechanisms:
- `Position Table`
The `Position Table` displays information about the current position, including:
> Position Duration : how long the position has been open for.
> Indicates if the side is Long or Short, depending on if it is long or short.
> Entry Price: the price the position was entered at.
> Current Price (% Dif): the current price of the underlying and the %-difference between the entry price and the current price.
> Max Profit ($/%): the maximum profit reached in $ and % terms.
> Current PnL ($/%) : the current PnL for the open position.
- `Performance Table`
The `Performance Table` displays information regarding the overall performance of the algorithm since its `Start Date`. These data include:
> Initial Equity ($): The initial equity the algorithm started with.
> Current Equity ($): The current total equity of the account (including open positions)
> Net Profits ($|%) : The overall net profit in $ and % terms.
> Long / Short Trade Counts: The respective trade counts for the positions entered.
> Total Closed Trades: The running sum of the number of trades closed.
> Profitability: The calculation of the number of profitable trades over the total number of
trades.
> Avg. Profit / Trade: The calculation of the average profit per trade in both $ and % terms.
> Avg. Loss / Trade: The calculation of the average loss per trade in both $ and % terms.
> Max Run-Up: The maximum run-up the algorithm has seen in both $ and % terms.
> Max Drawdown: The maximum draw-down the algorithm has seen in both $ and % terms.
> Return-Over-Max-Drawdown: the ratio of the maximum drawdown against the current net profits.
- `Text Output`
LTA will output, if desired, signals to the text output field every time it analysis or performs and action. These messages can include information such as:
"
08:00:00 >> AM Protocol activated ... exiting position ...
08:00:00 >> Exit Order Created for qty: 2, profit: 380 (4.34%)
...
09:30:00 >> Checking conditions ...
09:30:00 >> AM protocol prevented entry ... waiting ...
"
This way, you can keep an eye out on what is happening "under the hood", as it were.
LTA will produce a message at the end of its assessment at the end of each candle interval, as well as when a position is exited due to a `Stop` or due to `AMS` being activated.
Additionally, the `Text Output` includes a initial message, but for space-constraints, this
can be toggled off with the `Blank Text Output` option within LTA's configurations.
For additional information, please refer to the Author's Instructions below.